/**
 * Copyright (C) 2009-2012, KingHool.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses.
 */
package com.kinghool.smodel.listener;

/**
 * 
 * @Author Allen Deng(dengtailin@gmail.com) 
 */
public class ModelLoadStatusEvent {
    public final static String STATUS_READY = "STATUS_READY";
    public final static String STATUS_LOADING = "STATUS_LOADING";
    public final static String STATUS_FAIL = "STATUS_FAIL";   
    
    public final static ModelLoadStatusEvent READY = new ModelLoadStatusEvent(STATUS_READY);
    public final static ModelLoadStatusEvent LOADING = new ModelLoadStatusEvent(STATUS_LOADING);
    public final static ModelLoadStatusEvent FAIL = new ModelLoadStatusEvent(STATUS_FAIL);
    
    private final String eventName;
    
    private ModelLoadStatusEvent(String eventName) {    	 
		this.eventName = eventName;
    }
    
    public String getEvent() {
    	return eventName;
    }
    
    public boolean isModelLoaded() {
    	return STATUS_READY.equals(eventName);
    }
    public boolean isModelLoading() {
    	return STATUS_LOADING.equals(eventName);
    } 
    
    public boolean isModelLoadFailed() {
    	return STATUS_FAIL.equals(eventName);
    }
}
